package cn.fr4nk.crawler.task;

import java.sql.Timestamp;

/**
 * 定义抓取任务
 */
public class CrawlerTask {

	protected final String url;
	private int status;		// 0-未处理，1-处理中，2-完成，-1~失败
	private String handler; // 处理类名
	private Timestamp createTime; // 创建时间
	private Timestamp completeTime; // 结束时间

	public CrawlerTask(String url) {
		this.url = url;
		this.status  = 0;
		this.createTime = new Timestamp(System.currentTimeMillis());
	}

	public String getUrl() {
		return url;
	}

	public String getHandler() {
		return handler;
	}

	public void setHandler(String handler) {
		this.handler = handler;
	}

	public Timestamp getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	public Timestamp getCompleteTime() {
		return completeTime;
	}

	public void setCompleteTime(Timestamp completeTime) {
		this.completeTime = completeTime;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

}
